<?php get_header() ?>

<div class="content-header">
	<ul class="content-header-nav">
		<?php dpa_header_tabs() ?>
	</ul>
</div>

<div id="content">
	<?php do_action( 'template_notices' ) ?>

	<div id="dpa">
		<div id="dpa-graphs">
			<?php if ( dpa_has_categories( array( 'type' => 'overall' ) ) ) : ?>
				<?php while ( dpa_achievement_categories() ) : dpa_the_category(); ?>

					<div class="graph fullsize">
						<div class="bar <?php if ( dpa_get_category_percentage() < 100 ) echo ' flatright'; ?>" style="width: <?php dpa_category_percentage() ?>%"></div>
						<div class="caption"><p><?php _e( 'Total Completed: ', 'dpa' ) ?><?php dpa_category_number_unlocked() ?> / <?php dpa_category_number_total() ?></p></div>
					</div>

				<?php endwhile; ?>
			<?php endif; ?>

			<?php if ( dpa_has_categories() ) : ?>
				<?php while ( dpa_achievement_categories() ) : dpa_the_category(); ?>

					<div class="graph halfsize <?php dpa_category_slug() ?>">
						<div class="bar <?php if ( dpa_get_category_percentage() < 100 ) echo ' flatright'; ?>" style="width: <?php dpa_category_percentage() ?>%"></div>
						<div class="caption"><p><?php dpa_category_name() ?>: <?php dpa_category_number_unlocked() ?> / <?php dpa_category_number_total() ?></p></div>
					</div>

				<?php endwhile; ?>
			<?php endif; ?>
		</div>

		<?php if ( dpa_has_achievements( array( 'type' => 'recent', 'limit' => 5 ) ) ) : ?>

			<h2><?php _e( 'Recent Achievements', 'dpa' ); ?></h2>
			<?php while ( dpa_user_achievements() ) : dpa_the_achievement(); ?>

				<ul id="dpa-recentslist">
					<li>
						<p><span class="dpa-title"><?php dpa_achievement_name() ?></span> - <?php dpa_achievement_description() ?><span class="dpa-timestamp"><?php dpa_achievement_unlocked_date() ?></span></p>
					</li>
				</ul>
	
			<?php endwhile; ?>

		<?php endif; ?>

	</div>
</div>

<?php get_footer() ?>